from selenium.webdriver.support.wait import WebDriverWait

#定义博客园的基类
from utils import UtilsDriver

#对象层基类封装
class BasePage:
    def __init__(self):
        #获取博客园浏览器驱动
        self.driver = UtilsDriver.get_driver()

    def get_element(self,location):
        wait = WebDriverWait(self.driver,10,1)
        element = wait.until(lambda x: x.find_elment(*location))
        return element

#操作层基类封装
class BaseHandle:
    def input_text(self,element,text):
        element.clear()
        element.send_keys(text)